<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>AIfES 2: ailayer_relu.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
</script>
<script type="text/javascript" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="AIfES_logo_small.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">AIfES 2
   &#160;<span id="projectnumber">2.0.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('ailayer__relu_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">ailayer_relu.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="ailayer__relu_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160; </div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<span class="preprocessor">#ifndef RELU_LAYER</span></div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="preprocessor">#define RELU_LAYER</span></div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160; </div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="aifes__core_8h.html">core/aifes_core.h</a>&quot;</span></div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160; </div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structailayer__relu.html">ailayer_relu</a>     <a class="code" href="structailayer__relu.html">ailayer_relu_t</a>;</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160; </div>
<div class="line"><a name="l00051"></a><span class="lineno"><a class="line" href="structailayer__relu.html">   51</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structailayer__relu.html">ailayer_relu</a> {</div>
<div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="structailayer__relu.html#ab13782a46e3804246bf82a92955096b3">   52</a></span>&#160;    <a class="code" href="structailayer.html">ailayer_t</a> <a class="code" href="structailayer__relu.html#ab13782a46e3804246bf82a92955096b3">base</a>; </div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160; </div>
<div class="line"><a name="l00069"></a><span class="lineno"><a class="line" href="structailayer__relu.html#aa86168e5f130c59eacbedb95be431aab">   69</a></span>&#160;    void (*<a class="code" href="structailayer__relu.html#aa86168e5f130c59eacbedb95be431aab">relu</a>)(<span class="keyword">const</span> <a class="code" href="structaitensor.html">aitensor_t</a> *x, <a class="code" href="structaitensor.html">aitensor_t</a> *result);</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160; </div>
<div class="line"><a name="l00084"></a><span class="lineno"><a class="line" href="structailayer__relu.html#a9ecbdfe6b09d45308df2145094445ab9">   84</a></span>&#160;    void (*<a class="code" href="structailayer__relu.html#a9ecbdfe6b09d45308df2145094445ab9">d_relu</a>)(<span class="keyword">const</span> <a class="code" href="structaitensor.html">aitensor_t</a> *x, <a class="code" href="structaitensor.html">aitensor_t</a> *result);</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160; </div>
<div class="line"><a name="l00093"></a><span class="lineno"><a class="line" href="structailayer__relu.html#a50f5e44b0fca9c1e79a5287adb4a59eb">   93</a></span>&#160;    void (*<a class="code" href="structailayer__relu.html#a50f5e44b0fca9c1e79a5287adb4a59eb">multiply</a>)(<span class="keyword">const</span> <a class="code" href="structaitensor.html">aitensor_t</a> *a, <span class="keyword">const</span> <a class="code" href="structaitensor.html">aitensor_t</a> *b, <a class="code" href="structaitensor.html">aitensor_t</a> *result);</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;};</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160; </div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;<span class="keyword">extern</span> <span class="keyword">const</span> <a class="code" href="structaicore__layertype.html">aicore_layertype_t</a> *<a class="code" href="ailayer__relu_8h.html#a5b239b84a59fbae4016ea97cf0024689">ailayer_relu_type</a>;</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160; </div>
<div class="line"><a name="l00114"></a><span class="lineno"><a class="line" href="ailayer__relu_8h.html#a54f1a21cb4a0714fe54d2a446bfe8424">  114</a></span>&#160;<a class="code" href="structailayer.html">ailayer_t</a> *<a class="code" href="ailayer__relu_8h.html#a54f1a21cb4a0714fe54d2a446bfe8424">ailayer_relu</a>(<a class="code" href="structailayer__relu.html">ailayer_relu_t</a> *layer, <a class="code" href="structailayer.html">ailayer_t</a> *input_layer);</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160; </div>
<div class="line"><a name="l00136"></a><span class="lineno"><a class="line" href="ailayer__relu_8h.html#a178711a21fd2f8f43d4942bb3435b8f8">  136</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="ailayer__relu_8h.html#a178711a21fd2f8f43d4942bb3435b8f8">ailayer_relu_forward</a>(<a class="code" href="structailayer.html">ailayer_t</a> *<span class="keyword">self</span>);</div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160; </div>
<div class="line"><a name="l00161"></a><span class="lineno"><a class="line" href="ailayer__relu_8h.html#ab2401e9f8513a088f84eb8cef3b5a1a1">  161</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="ailayer__relu_8h.html#ab2401e9f8513a088f84eb8cef3b5a1a1">ailayer_relu_backward</a>(<a class="code" href="structailayer.html">ailayer_t</a> *<span class="keyword">self</span>);</div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160; </div>
<div class="line"><a name="l00172"></a><span class="lineno"><a class="line" href="ailayer__relu_8h.html#ae5725b5af970de000d58cb13c43d3ba2">  172</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="ailayer__relu_8h.html#ae5725b5af970de000d58cb13c43d3ba2">ailayer_relu_calc_result_shape</a>(<a class="code" href="structailayer.html">ailayer_t</a> *<span class="keyword">self</span>);</div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160; </div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;<span class="preprocessor">#ifdef AIDEBUG_PRINT_MODULE_SPECS</span></div>
<div class="line"><a name="l00179"></a><span class="lineno"><a class="line" href="ailayer__relu_8h.html#acaea6f1b3be61f91330c1a25d57892ab">  179</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="ailayer__relu_8h.html#acaea6f1b3be61f91330c1a25d57892ab">ailayer_relu_print_specs</a>(<span class="keyword">const</span> <a class="code" href="structailayer.html">ailayer_t</a> *<span class="keyword">self</span>);</div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;<span class="preprocessor">#endif </span><span class="comment">// AIDEBUG_PRINT_MODULE_SPECS</span></div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160; </div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;<span class="preprocessor">#endif </span><span class="comment">// RELU_LAYER</span></div>
<div class="ttc" id="aaifes__core_8h_html"><div class="ttname"><a href="aifes__core_8h.html">aifes_core.h</a></div><div class="ttdoc">AIfES 2 core interface.</div></div>
<div class="ttc" id="aailayer__relu_8h_html_a178711a21fd2f8f43d4942bb3435b8f8"><div class="ttname"><a href="ailayer__relu_8h.html#a178711a21fd2f8f43d4942bb3435b8f8">ailayer_relu_forward</a></div><div class="ttdeci">void ailayer_relu_forward(ailayer_t *self)</div><div class="ttdoc">Calculate the forward pass for given ReLU layer.</div></div>
<div class="ttc" id="aailayer__relu_8h_html_a54f1a21cb4a0714fe54d2a446bfe8424"><div class="ttname"><a href="ailayer__relu_8h.html#a54f1a21cb4a0714fe54d2a446bfe8424">ailayer_relu</a></div><div class="ttdeci">ailayer_t * ailayer_relu(ailayer_relu_t *layer, ailayer_t *input_layer)</div><div class="ttdoc">Initialize and connect the given ReLU layer.</div></div>
<div class="ttc" id="aailayer__relu_8h_html_a5b239b84a59fbae4016ea97cf0024689"><div class="ttname"><a href="ailayer__relu_8h.html#a5b239b84a59fbae4016ea97cf0024689">ailayer_relu_type</a></div><div class="ttdeci">const aicore_layertype_t * ailayer_relu_type</div><div class="ttdoc">ReLU layer type.</div></div>
<div class="ttc" id="aailayer__relu_8h_html_ab2401e9f8513a088f84eb8cef3b5a1a1"><div class="ttname"><a href="ailayer__relu_8h.html#ab2401e9f8513a088f84eb8cef3b5a1a1">ailayer_relu_backward</a></div><div class="ttdeci">void ailayer_relu_backward(ailayer_t *self)</div><div class="ttdoc">Calculate the backward pass for the given ReLU layer.</div></div>
<div class="ttc" id="aailayer__relu_8h_html_acaea6f1b3be61f91330c1a25d57892ab"><div class="ttname"><a href="ailayer__relu_8h.html#acaea6f1b3be61f91330c1a25d57892ab">ailayer_relu_print_specs</a></div><div class="ttdeci">void ailayer_relu_print_specs(const ailayer_t *self)</div><div class="ttdoc">Print the layer specification.</div></div>
<div class="ttc" id="aailayer__relu_8h_html_ae5725b5af970de000d58cb13c43d3ba2"><div class="ttname"><a href="ailayer__relu_8h.html#ae5725b5af970de000d58cb13c43d3ba2">ailayer_relu_calc_result_shape</a></div><div class="ttdeci">void ailayer_relu_calc_result_shape(ailayer_t *self)</div><div class="ttdoc">Calculate the shape of the result tensor.</div></div>
<div class="ttc" id="astructaicore__layertype_html"><div class="ttname"><a href="structaicore__layertype.html">aicore_layertype</a></div><div class="ttdoc">Type indicator of the layer.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:82</div></div>
<div class="ttc" id="astructailayer__relu_html"><div class="ttname"><a href="structailayer__relu.html">ailayer_relu</a></div><div class="ttdoc">General ReLU layer  struct.</div><div class="ttdef"><b>Definition:</b> ailayer_relu.h:51</div></div>
<div class="ttc" id="astructailayer__relu_html_a50f5e44b0fca9c1e79a5287adb4a59eb"><div class="ttname"><a href="structailayer__relu.html#a50f5e44b0fca9c1e79a5287adb4a59eb">ailayer_relu::multiply</a></div><div class="ttdeci">void(* multiply)(const aitensor_t *a, const aitensor_t *b, aitensor_t *result)</div><div class="ttdoc">Required math function: Element wise tensor multiplication.</div><div class="ttdef"><b>Definition:</b> ailayer_relu.h:93</div></div>
<div class="ttc" id="astructailayer__relu_html_a9ecbdfe6b09d45308df2145094445ab9"><div class="ttname"><a href="structailayer__relu.html#a9ecbdfe6b09d45308df2145094445ab9">ailayer_relu::d_relu</a></div><div class="ttdeci">void(* d_relu)(const aitensor_t *x, aitensor_t *result)</div><div class="ttdoc">Required math function: Derivative of ReLU.</div><div class="ttdef"><b>Definition:</b> ailayer_relu.h:84</div></div>
<div class="ttc" id="astructailayer__relu_html_aa86168e5f130c59eacbedb95be431aab"><div class="ttname"><a href="structailayer__relu.html#aa86168e5f130c59eacbedb95be431aab">ailayer_relu::relu</a></div><div class="ttdeci">void(* relu)(const aitensor_t *x, aitensor_t *result)</div><div class="ttdoc">Required math function: ReLU.</div><div class="ttdef"><b>Definition:</b> ailayer_relu.h:69</div></div>
<div class="ttc" id="astructailayer__relu_html_ab13782a46e3804246bf82a92955096b3"><div class="ttname"><a href="structailayer__relu.html#ab13782a46e3804246bf82a92955096b3">ailayer_relu::base</a></div><div class="ttdeci">ailayer_t base</div><div class="ttdoc">Inherited field members from general ailayer struct.</div><div class="ttdef"><b>Definition:</b> ailayer_relu.h:52</div></div>
<div class="ttc" id="astructailayer_html"><div class="ttname"><a href="structailayer.html">ailayer</a></div><div class="ttdoc">AIfES layer interface.</div><div class="ttdef"><b>Definition:</b> aifes_core.h:252</div></div>
<div class="ttc" id="astructaitensor_html"><div class="ttname"><a href="structaitensor.html">aitensor</a></div><div class="ttdoc">A tensor in AIfES.</div><div class="ttdef"><b>Definition:</b> aifes_math.h:89</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_1e5d3661ed79af157d57e64a38265d09.html">basic</a></li><li class="navelem"><a class="el" href="dir_90008ee2b0f86999412b56217da88d54.html">base</a></li><li class="navelem"><a class="el" href="dir_ad1f3f314a3dbbd36ea1eb350865d78d.html">ailayer</a></li><li class="navelem"><a class="el" href="ailayer__relu_8h.html">ailayer_relu.h</a></li>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
